local ClientOHOH = _G.ClientOHOH;

local M = ClientOHOH.class.new(script, ClientOHOH.files.OHOHOLYBUIBase());
local CallBackManager = ClientOHOH.load.CallBackManager();
local LanguageHelper=_G.LanguageHelper 

function InitInsts(ui)
	ui.insts = {};
	ui.insts.Tip = "ctrl.text";
	ui.insts.YesBtn = "ctrl.btn_yes";
	ui.insts.NoBtn =  "ctrl.btn_no";
end


function M.new(...)
	return M(...);
end;

function M.ctor(self)
	InitInsts(self)
	M.super.ctor(self, ClientOHOH:GetPath_Loop("ReplicatedStorage.Resource.UI.TradeReceiveMsgGui"));


	CallBackManager:AddRbxConnect(self,self.insts.YesBtn.Activated, function()
		if self.CallBack then
			self.CallBack(true)
		end
		self:Hide()
	end);
	CallBackManager:AddRbxConnect(self,self.insts.NoBtn.Activated, function()
		if self.CallBack then
			self.CallBack(false)
		end
		self:Hide()
	end);
end;



function M.dtor(self)
	M.super.dtor(self);
end;

function M.OnShow(self,name,callback)
	self.insts.Tip.Text=LanguageHelper:GetText(10101,{"%%ARG1"},{name}) 
	 self.CallBack=callback
end


return M
